# -*- Mode: shell-script -*-
#############################################################################
##
#A  irredsol.grp                GAP group library                  Mark Short
##
##
#Y  Copyright (C) 2018-2021, Carnegie Mellon University
#Y  All rights reserved.  See LICENSE for details.
#Y  
#Y  This work is based on GAP version 3, with some files from version 4.  GAP is
#Y  Copyright (C) (1987--2021) by the GAP Group (www.gap-system.org).
##
##  This file contains the  functions and  data for the  irreducible solvable
##  matrix group library.  It contains  exactely one member  for each of  the
##  370  conjugacy  classes of  irreducible  solvable subgroups of  $GL(n,p)$
##  where $1 < n$, $p$ is a prime, and $p^n < 256$.  
##
##  By well known  theory, this data also  doubles as a  library of primitive
##  solvable permutation groups of non-prime degree <256.  To access the data
##  in this  form, you must  first build the  matrix group(s) of interest and
##  then call the function PrimPermGroup( <matgrp>  ).  This function returns
##  a permutation  group  isomorphic   to   the  semidirect product   of   an
##  irreducible matrix group (over a finite field)  and its underlying vector
##  space.
##
##


#############################################################################
##
#V  IrredSolJSGens[]  . . . . . . . . . . . . . . . generators for the groups
##
##  'IrredSolJSGens[<n>][<p>][<k>]' is a generating set for the <k>-th
##  JS-maximal of GL(<n>,<p>).
##  This generating set is polycyclic, i.e. forms an AG-system for the group.
##  A JS-maximal is a maximal irreducible solvable subgroup of GL(<n>,<p>)
##  (for a few exceptional small values of n and p this group isn't maximal).
##  Every group in the library is generated with reference to the generating
##  set of one of these JS-maximals, called its guardian (a group may be a
##  subgroup of several JS-maximals but it only has one guardian).
##
IrredSolJSGens := [
 [], # GL(1,*)
 [   # GL(2,*)
  [], # GL(2,1)
  [   # GL(2,2)
   [], # 1-th JS-maximal
   [   # 2-th JS-maximal
    [[1,0],[1,1]]*Z(2)^0,
    [[0,1],[1,1]]*Z(2)^0 ]],
  [   # GL(2,3)
   [   # 1-th JS-maximal
    [[0,1],[1,0]]*Z(3)^0,
    [[2,0],[0,1]]*Z(3)^0,
    [[1,0],[0,2]]*Z(3)^0 ],
   [   # 2-th JS-maximal
    [[1,0],[2,2]]*Z(3)^0,
    [[0,1],[1,2]]*Z(3)^0 ],
   [   # 3-th JS-maximal
    [[1,2],[0,2]]*Z(3)^0,
    [[1,2],[0,1]]*Z(3)^0,
    [[0,2],[1,0]]*Z(3)^0,
    [[1,1],[1,2]]*Z(3)^0,
    [[2,0],[0,2]]*Z(3)^0 ]],
  [], # GL(2,4)
  [   # GL(2,5)
   [   # 1-th JS-maximal
    [[0,1],[1,0]]*Z(5)^0,
    [[2,0],[0,1]]*Z(5)^0,
    [[1,0],[0,2]]*Z(5)^0 ],
   [   # 2-th JS-maximal
    [[1,0],[4,4]]*Z(5)^0,
    [[0,1],[3,4]]*Z(5)^0 ],
   [], # 3-th JS-maximal
   [   # 4-th JS-maximal
    [[1,4],[4,4]]*Z(5)^0,
    [[3,4],[3,1]]*Z(5)^0,
    [[0,2],[2,0]]*Z(5)^0,
    [[2,0],[0,3]]*Z(5)^0,
    [[2,0],[0,2]]*Z(5)^0 ]],
  [], # GL(2,6)
  [   # GL(2,7)
   [   # 1-th JS-maximal
    [[0,1],[1,0]]*Z(7)^0,
    [[3,0],[0,1]]*Z(7)^0,
    [[1,0],[0,3]]*Z(7)^0 ],
   [   # 2-th JS-maximal
    [[1,0],[6,6]]*Z(7)^0,
    [[0,1],[4,6]]*Z(7)^0 ],
   [   # 3-th JS-maximal
    [[4,1],[4,3]]*Z(7)^0,
    [[6,2],[3,0]]*Z(7)^0,
    [[0,6],[1,0]]*Z(7)^0,
    [[2,3],[3,5]]*Z(7)^0,
    [[3,0],[0,3]]*Z(7)^0 ]],
  [], # GL(2,8)
  [], # GL(2,9)
  [], # GL(2,10)
  [   # GL(2,11)
   [   # 1-th JS-maximal
    [[0,1],[1,0]]*Z(11)^0,
    [[2,0],[0,1]]*Z(11)^0,
    [[1,0],[0,2]]*Z(11)^0 ],
   [   # 2-th JS-maximal
    [[1,0],[10,10]]*Z(11)^0,
    [[0,1],[4,10]]*Z(11)^0 ],
   [   # 3-th JS-maximal
    [[4,5],[8,7]]*Z(11)^0,
    [[4,7],[8,6]]*Z(11)^0,
    [[0,10],[1,0]]*Z(11)^0,
    [[1,3],[3,10]]*Z(11)^0,
    [[2,0],[0,2]]*Z(11)^0 ]],
  [], # GL(2,12)
  [   # GL(2,13)
   [   # 1-th JS-maximal
    [[0,1],[1,0]]*Z(13)^0,
    [[2,0],[0,1]]*Z(13)^0,
    [[1,0],[0,2]]*Z(13)^0 ],
   [   # 2-th JS-maximal
    [[1,0],[12,12]]*Z(13)^0,
    [[0,1],[11,12]]*Z(13)^0 ],
   [], # 3-th JS-maximal
   [   # 4-th JS-maximal
    [[3,10],[10,10]]*Z(13)^0,
    [[2,3],[2,10]]*Z(13)^0,
    [[0,5],[5,0]]*Z(13)^0,
    [[5,0],[0,8]]*Z(13)^0,
    [[2,0],[0,2]]*Z(13)^0 ]]],
 [   # GL(3,*)
  [], # GL(3,1)
  [   # GL(3,2)
   [], # 1-th JS-maximal
   [   # 2-th JS-maximal
    [[1,0,0],[0,0,1],[1,1,1]]*Z(2)^0,
    [[0,1,0],[0,0,1],[1,0,1]]*Z(2)^0 ]],
  [   # GL(3,3)
   [   # 1-th JS-maximal
    [[0,1,0],[1,0,0],[0,0,1]]*Z(3)^0,
    [[0,1,0],[0,0,1],[1,0,0]]*Z(3)^0,
    [[2,0,0],[0,1,0],[0,0,1]]*Z(3)^0,
    [[1,0,0],[0,2,0],[0,0,1]]*Z(3)^0,
    [[1,0,0],[0,1,0],[0,0,2]]*Z(3)^0 ],
   [   # 2-th JS-maximal
    [[1,0,0],[2,0,1],[0,2,2]]*Z(3)^0,
    [[0,1,0],[0,0,1],[2,0,1]]*Z(3)^0 ]],
  [], # GL(3,4)
  [   # GL(3,5)
   [   # 1-th JS-maximal
    [[0,1,0],[1,0,0],[0,0,1]]*Z(5)^0,
    [[0,1,0],[0,0,1],[1,0,0]]*Z(5)^0,
    [[2,0,0],[0,1,0],[0,0,1]]*Z(5)^0,
    [[1,0,0],[0,2,0],[0,0,1]]*Z(5)^0,
    [[1,0,0],[0,1,0],[0,0,2]]*Z(5)^0 ],
   [   # 2-th JS-maximal
    [[1,0,0],[3,2,2],[1,4,2]]*Z(5)^0,
    [[0,1,0],[0,0,1],[3,0,4]]*Z(5)^0 ]]],
 [   # GL(4,*)
  [], # GL(4,1)
  [   # GL(4,2)
   [], # 1-th JS-maximal
   [   # 2-th JS-maximal
    [[0,0,1,0],[0,0,0,1],[1,0,0,0],[0,1,0,0]]*Z(2)^0,
    [[1,0,0,0],[1,1,0,0],[0,0,1,0],[0,0,0,1]]*Z(2)^0,
    [[0,1,0,0],[1,1,0,0],[0,0,1,0],[0,0,0,1]]*Z(2)^0,
    [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,1,1]]*Z(2)^0,
    [[1,0,0,0],[0,1,0,0],[0,0,0,1],[0,0,1,1]]*Z(2)^0 ],
   [], # 3-th JS-maximal
   [], # 4-th JS-maximal
   [   # 5-th JS-maximal
    [[1,0,0,0],[0,0,1,0],[1,0,0,1],[1,1,1,1]]*Z(2)^0,
    [[0,1,0,0],[0,0,1,0],[0,0,0,1],[1,0,0,1]]*Z(2)^0 ]],
  [   # GL(4,3)
   [   # 1-th JS-maximal
    [[0,1,0,0],[1,0,0,0],[0,0,1,0],[0,0,0,1]]*Z(3)^0,
    [[0,1,0,0],[0,0,1,0],[1,0,0,0],[0,0,0,1]]*Z(3)^0,
    [[0,0,0,1],[0,0,1,0],[0,1,0,0],[1,0,0,0]]*Z(3)^0,
    [[0,1,0,0],[1,0,0,0],[0,0,0,1],[0,0,1,0]]*Z(3)^0,
    [[2,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]*Z(3)^0,
    [[1,0,0,0],[0,2,0,0],[0,0,1,0],[0,0,0,1]]*Z(3)^0,
    [[1,0,0,0],[0,1,0,0],[0,0,2,0],[0,0,0,1]]*Z(3)^0,
    [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,2]]*Z(3)^0 ],
   [   # 2-th JS-maximal
    [[0,0,1,0],[0,0,0,1],[1,0,0,0],[0,1,0,0]]*Z(3)^0,
    [[1,0,0,0],[2,2,0,0],[0,0,1,0],[0,0,0,1]]*Z(3)^0,
    [[0,1,0,0],[1,2,0,0],[0,0,1,0],[0,0,0,1]]*Z(3)^0,
    [[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,2,2]]*Z(3)^0,
    [[1,0,0,0],[0,1,0,0],[0,0,0,1],[0,0,1,2]]*Z(3)^0 ],
   [   # 3-th JS-maximal
    [[0,0,1,0],[0,0,0,1],[1,0,0,0],[0,1,0,0]]*Z(3)^0,
    [[1,2,0,0],[0,2,0,0],[0,0,1,0],[0,0,0,1]]*Z(3)^0,
    [[1,2,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]*Z(3)^0,
    [[0,2,0,0],[1,0,0,0],[0,0,1,0],[0,0,0,1]]*Z(3)^0,
    [[1,1,0,0],[1,2,0,0],[0,0,1,0],[0,0,0,1]]*Z(3)^0,
    [[1,0,0,0],[0,1,0,0],[0,0,1,2],[0,0,0,2]]*Z(3)^0,
    [[1,0,0,0],[0,1,0,0],[0,0,1,2],[0,0,0,1]]*Z(3)^0,
    [[1,0,0,0],[0,1,0,0],[0,0,0,2],[0,0,1,0]]*Z(3)^0,
    [[1,0,0,0],[0,1,0,0],[0,0,1,1],[0,0,1,2]]*Z(3)^0 ],
   [], # 4-th JS-maximal
   [   # 5-th JS-maximal
    [[1,0,0,0],[0,0,0,1],[1,2,1,2],[0,2,2,1]]*Z(3)^0,
    [[0,1,0,0],[0,0,1,0],[0,0,0,1],[1,0,0,2]]*Z(3)^0 ],
   [   # 6-th JS-maximal
    [[1,0,0,0],[0,1,0,0],[2,0,2,0],[0,2,0,2]]*Z(3)^0,
    [[0,0,1,0],[0,0,0,1],[1,0,2,0],[0,1,0,2]]*Z(3)^0,
    [[1,2,0,0],[0,2,0,0],[0,0,1,2],[0,0,0,2]]*Z(3)^0,
    [[1,2,0,0],[0,1,0,0],[0,0,1,2],[0,0,0,1]]*Z(3)^0,
    [[0,2,0,0],[1,0,0,0],[0,0,0,2],[0,0,1,0]]*Z(3)^0,
    [[1,1,0,0],[1,2,0,0],[0,0,1,1],[0,0,1,2]]*Z(3)^0 ],
   [   # 7-th JS-maximal
    [[1,0,0,0],[0,0,1,0],[0,1,0,0],[0,0,0,1]]*Z(3)^0,
    [[1,0,2,0],[0,1,0,2],[0,0,2,0],[0,0,0,2]]*Z(3)^0,
    [[1,0,2,0],[0,1,0,2],[0,0,1,0],[0,0,0,1]]*Z(3)^0,
    [[0,0,2,0],[0,0,0,2],[1,0,0,0],[0,1,0,0]]*Z(3)^0,
    [[1,0,1,0],[0,1,0,1],[1,0,2,0],[0,1,0,2]]*Z(3)^0,
    [[1,2,0,0],[0,2,0,0],[0,0,1,2],[0,0,0,2]]*Z(3)^0,
    [[1,2,0,0],[0,1,0,0],[0,0,1,2],[0,0,0,1]]*Z(3)^0,
    [[0,2,0,0],[1,0,0,0],[0,0,0,2],[0,0,1,0]]*Z(3)^0,
    [[1,1,0,0],[1,2,0,0],[0,0,1,1],[0,0,1,2]]*Z(3)^0 ],
   [   # 8-th JS-maximal
    [[1,0,0,1],[1,1,2,1],[2,0,0,1],[2,2,2,1]]*Z(3)^0,
    [[2,0,2,0],[0,1,0,1],[2,2,1,1],[1,2,2,1]]*Z(3)^0,
    [[0,0,1,0],[0,0,0,1],[1,0,0,0],[0,1,0,0]]*Z(3)^0,
    [[1,0,0,0],[0,1,0,0],[0,0,2,0],[0,0,0,2]]*Z(3)^0,
    [[0,2,0,0],[1,0,0,0],[0,0,0,2],[0,0,1,0]]*Z(3)^0,
    [[1,1,0,0],[1,2,0,0],[0,0,1,1],[0,0,1,2]]*Z(3)^0,
    [[2,0,0,0],[0,2,0,0],[0,0,2,0],[0,0,0,2]]*Z(3)^0 ]]],
 [   # GL(5,*)
  [], # GL(5,1)
  [   # GL(5,2)
   [], # 1-th JS-maximal
   [   # 2-th JS-maximal
    [[1,0,0,0,0],[0,0,1,0,0],[0,0,0,0,1],[0,1,0,0,1],[0,1,0,1,1]]*Z(2)^0,
    [[0,1,0,0,0],[0,0,1,0,0],[0,0,0,1,0],[0,0,0,0,1],[1,0,0,1,0]]*Z(2)^0 ]],
  [   # GL(5,3)
   [   # 1-th JS-maximal
    [[0,1,0,0,0],[0,0,0,1,0],[1,0,0,0,0],[0,0,1,0,0],[0,0,0,0,1]]*Z(3)^0,
    [[0,1,0,0,0],[0,0,1,0,0],[0,0,0,1,0],[0,0,0,0,1],[1,0,0,0,0]]*Z(3)^0,
    [[2,0,0,0,0],[0,1,0,0,0],[0,0,1,0,0],[0,0,0,1,0],[0,0,0,0,1]]*Z(3)^0,
    [[1,0,0,0,0],[0,2,0,0,0],[0,0,1,0,0],[0,0,0,1,0],[0,0,0,0,1]]*Z(3)^0,
    [[1,0,0,0,0],[0,1,0,0,0],[0,0,2,0,0],[0,0,0,1,0],[0,0,0,0,1]]*Z(3)^0,
    [[1,0,0,0,0],[0,1,0,0,0],[0,0,1,0,0],[0,0,0,2,0],[0,0,0,0,1]]*Z(3)^0,
    [[1,0,0,0,0],[0,1,0,0,0],[0,0,1,0,0],[0,0,0,1,0],[0,0,0,0,2]]*Z(3)^0 ],
   [   # 2-th JS-maximal
    [[1,0,0,0,0],[0,0,0,1,0],[1,2,1,2,1],[0,2,2,0,1],[0,1,2,1,1]]*Z(3)^0,
    [[0,1,0,0,0],[0,0,1,0,0],[0,0,0,1,0],[0,0,0,0,1],[2,0,2,0,2]]*Z(3)^0 ]]],
 [   # GL(6,*)
  [], # GL(6,1)
  [   # GL(6,2)
   [], # 1-th JS-maximal
   [], # 2-th JS-maximal
   [   # 3-th JS-maximal
    [[0,0,1,0,0,0],[0,0,0,1,0,0],[1,0,0,0,0,0],
     [0,1,0,0,0,0],[0,0,0,0,1,0],[0,0,0,0,0,1]]*Z(2)^0,
    [[0,0,1,0,0,0],[0,0,0,1,0,0],[0,0,0,0,1,0],
     [0,0,0,0,0,1],[1,0,0,0,0,0],[0,1,0,0,0,0]]*Z(2)^0,
    [[1,0,0,0,0,0],[1,1,0,0,0,0],[0,0,1,0,0,0],
     [0,0,0,1,0,0],[0,0,0,0,1,0],[0,0,0,0,0,1]]*Z(2)^0,
    [[0,1,0,0,0,0],[1,1,0,0,0,0],[0,0,1,0,0,0],
     [0,0,0,1,0,0],[0,0,0,0,1,0],[0,0,0,0,0,1]]*Z(2)^0,
    [[1,0,0,0,0,0],[0,1,0,0,0,0],[0,0,1,0,0,0],
     [0,0,1,1,0,0],[0,0,0,0,1,0],[0,0,0,0,0,1]]*Z(2)^0,
    [[1,0,0,0,0,0],[0,1,0,0,0,0],[0,0,0,1,0,0],
     [0,0,1,1,0,0],[0,0,0,0,1,0],[0,0,0,0,0,1]]*Z(2)^0,
    [[1,0,0,0,0,0],[0,1,0,0,0,0],[0,0,1,0,0,0],
     [0,0,0,1,0,0],[0,0,0,0,1,0],[0,0,0,0,1,1]]*Z(2)^0,
    [[1,0,0,0,0,0],[0,1,0,0,0,0],[0,0,1,0,0,0],
     [0,0,0,1,0,0],[0,0,0,0,0,1],[0,0,0,0,1,1]]*Z(2)^0 ],
   [], # 4-th JS-maximal
   [], # 5-th JS-maximal
   [   # 6-th JS-maximal
    [[0,0,0,1,0,0],[0,0,0,0,1,0],[0,0,0,0,0,1],
     [1,0,0,0,0,0],[0,1,0,0,0,0],[0,0,1,0,0,0]]*Z(2)^0,
    [[1,0,0,0,0,0],[0,0,1,0,0,0],[1,1,1,0,0,0],
     [0,0,0,1,0,0],[0,0,0,0,1,0],[0,0,0,0,0,1]]*Z(2)^0,
    [[0,1,0,0,0,0],[0,0,1,0,0,0],[1,0,1,0,0,0],
     [0,0,0,1,0,0],[0,0,0,0,1,0],[0,0,0,0,0,1]]*Z(2)^0,
    [[1,0,0,0,0,0],[0,1,0,0,0,0],[0,0,1,0,0,0],
     [0,0,0,1,0,0],[0,0,0,0,0,1],[0,0,0,1,1,1]]*Z(2)^0,
    [[1,0,0,0,0,0],[0,1,0,0,0,0],[0,0,1,0,0,0],
     [0,0,0,0,1,0],[0,0,0,0,0,1],[0,0,0,1,0,1]]*Z(2)^0 ],
   [], # 7-th JS-maximal
   [   # 8-th JS-maximal
    [[1,0,0,0,0,0],[0,0,1,0,0,0],[0,0,0,0,1,0],
     [1,0,0,0,0,1],[1,1,1,0,0,1],[1,1,1,1,1,1]]*Z(2)^0,
    [[0,1,0,0,0,0],[0,0,1,0,0,0],[0,0,0,1,0,0],
     [0,0,0,0,1,0],[0,0,0,0,0,1],[1,0,0,0,0,1]]*Z(2)^0 ],
   [], # 9-th JS-maximal
   [], # 10-th JS-maximal
   [   # 11-th JS-maximal
    [[1,0,0,0,0,0],[1,1,0,0,0,0],[0,0,1,0,0,0],
     [0,0,1,1,0,0],[0,0,0,0,1,0],[0,0,0,0,1,1]]*Z(2)^0,
    [[1,0,0,0,0,0],[0,1,0,0,0,0],[0,0,1,0,0,0],
     [0,0,0,1,0,0],[0,0,0,0,0,1],[0,0,0,0,1,1]]*Z(2)^0,
    [[0,1,1,1,0,1],[1,1,1,0,1,1],[1,1,0,1,0,1],
     [1,0,1,1,1,1],[1,1,1,1,1,0],[1,0,1,0,0,1]]*Z(2)^0,
    [[0,1,1,1,1,1],[1,1,1,0,1,0],[1,1,0,1,1,1],
     [1,0,1,1,1,0],[0,1,0,1,1,0],[1,1,1,1,0,1]]*Z(2)^0,
    [[0,0,0,0,1,0],[0,0,0,0,0,1],[1,0,0,0,0,0],
     [0,1,0,0,0,0],[0,0,1,0,0,0],[0,0,0,1,0,0]]*Z(2)^0,
    [[1,0,0,0,0,0],[0,1,0,0,0,0],[0,0,0,1,0,0],
     [0,0,1,1,0,0],[0,0,0,0,1,1],[0,0,0,0,1,0]]*Z(2)^0,
    [[0,1,0,0,0,0],[1,1,0,0,0,0],[0,0,0,1,0,0],
     [0,0,1,1,0,0],[0,0,0,0,0,1],[0,0,0,0,1,1]]*Z(2)^0 ]]],
 [   # GL(7,*)
  [], # GL(7,1)
  [   # GL(7,2)
   [], # 1-th JS-maximal
   [   # 2-th JS-maximal
    [[1,0,0,0,0,0,0],[0,0,1,0,0,0,0],[0,0,0,0,1,0,0],[0,0,0,0,0,0,1],
     [0,1,1,0,0,0,0],[0,0,0,1,1,0,0],[0,0,0,0,0,1,1]]*Z(2)^0,
    [[0,1,0,0,0,0,0],[0,0,1,0,0,0,0],[0,0,0,1,0,0,0],[0,0,0,0,1,0,0],
     [0,0,0,0,0,1,0],[0,0,0,0,0,0,1],[1,1,0,0,0,0,0]]*Z(2)^0 ]]]];


#############################################################################
##
#V  IrredSolGropuList[] . . . . . . . . . . . . . . description of the groups
##
##  'IrredSolGroupList[<n>][<p>][<i>] is a list containing the information
##  about the <i>-th group from GL(<n>,<p>).
##  The groups are ordered with respect to the following criteria:
##      1. Increasing size
##      2. Increasing guardian number
##  If two groups have the same size and guardian, they are in no particular
##  order.
##
##  The list 'IrredSolGroupList[<n>][<p>][<i>] contains the following info:
##  Position: [1]:   the size of the group
##            [2]:   0 if group is linearly primitive,
##                   otherwise its minimal block size
##            [3]:   the number of the group's guardian,
##                   i.e. its position in 'IrredSolJSGens[<n>][<p>]'
##            [4..]: the group's generators in normal form
##                   (with respect to its guardian's AG-system)
##
IrredSolGroupList := [
 [], # GL(1,*)
 [   # GL(2,*)
  [], # GL(2,1)
  [   # GL(2,2)
   [   3, 0, 2, 0,1 ],
   [   6, 0, 2, 1,0, 0,1 ]],
  [   # GL(2,3)
   [   4, 1, 2, 0,2 ],
   [   8, 1, 1, 1,0,0, 0,1,0, 0,0,1 ],
   [   8, 0, 2, 1,1, 0,2 ],
   [   8, 0, 2, 0,1 ],
   [  16, 0, 2, 1,0, 0,1 ],
   [  24, 0, 3, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0 ],
   [  48, 0, 3, 1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0 ]],
  [], # GL(2,4)
  [   # GL(2,5)
   [   3, 0, 2, 0,8 ],
   [   6, 0, 2, 1,0, 0,8 ],
   [   6, 0, 2, 0,4 ],
   [   8, 1, 1, 1,2,0, 0,1,-1 ],
   [   8, 1, 1, 1,0,0, 0,1,-1 ],
   [   8, 1, 2, 0,3 ],
   [  12, 0, 2, 1,0, 0,4 ],
   [  12, 0, 2, 1,2, 0,4 ],
   [  12, 0, 2, 0,2 ],
   [  16, 1, 1, 1,1,0, 0,1,-1, 0,1,1 ],
   [  16, 1, 1, 1,0,0, 0,1,-1, 0,1,1 ],
   [  24, 0, 2, 1,1, 0,2 ],
   [  24, 0, 2, 1,0, 0,2 ],
   [  24, 0, 2, 0,1 ],
   [  24, 0, 4, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0 ],
   [  32, 1, 1, 1,0,0, 0,1,0, 0,0,1 ],
   [  48, 0, 2, 1,0, 0,1 ],
   [  48, 0, 4, 2,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0 ],
   [  96, 0, 4, 1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0 ]],
  [], # GL(2,6)
  [   # GL(2,7)
   [   4, 1, 2, 0,12 ],
   [   6, 1, 1, 1,0,0, 0,2,-2 ],
   [   8, 1, 1, 1,0,0, 0,3,0, 0,0,3 ],
   [   8, 0, 2, 1,3, 0,12 ],
   [   8, 0, 2, 0,6 ],
   [  12, 1, 1, 1,3,0, 0,3,3, 0,2,-2 ],
   [  12, 1, 1, 1,0,0, 0,3,3, 0,2,-2 ],
   [  12, 1, 2, 0,4 ],
   [  16, 0, 2, 1,0, 0,6 ],
   [  16, 0, 2, 0,3 ],
   [  16, 0, 2, 1,3, 0,6 ],
   [  18, 1, 1, 1,0,0, 0,2,-2, 0,2,2 ],
   [  24, 1, 1, 1,0,0, 0,3,0, 0,0,3, 0,2,-2 ],
   [  24, 1, 1, 1,0,0, 0,3,0, 0,0,3, 0,2,2 ],
   [  24, 0, 2, 0,2 ],
   [  24, 0, 2, 1,3, 0,4 ],
   [  24, 0, 3, 0,1,0,0,2, 0,0,1,0,0, 0,0,0,1,0 ],
   [  24, 0, 3, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0 ],
   [  32, 0, 2, 1,0, 0,3 ],
   [  36, 1, 1, 1,3,0, 0,3,3, 0,2,-2, 0,2,2 ],
   [  36, 1, 1, 1,0,0, 0,3,3, 0,2,-2, 0,2,2 ],
   [  48, 0, 2, 1,3, 0,2 ],
   [  48, 0, 2, 0,1 ],
   [  48, 0, 2, 1,0, 0,2 ],
   [  48, 0, 3, 1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0 ],
   [  72, 1, 1, 1,0,0, 0,3,0, 0,0,3, 0,2,-2, 0,2,2 ],
   [  72, 0, 3, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0, 0,0,0,0,2 ],
   [  96, 0, 2, 1,0, 0,1 ],
   [ 144, 0, 3, 1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0, 0,0,0,0,2 ]],
  [], # GL(2,8)
  [], # GL(2,9)
  [], # GL(2,10)
  [   # GL(2,11)
   [   3, 0, 2, 0,40 ],
   [   4, 1, 2, 0,30 ],
   [   6, 0, 2, 0,20 ],
   [   6, 0, 2, 1,0, 0,40 ],
   [   8, 1, 1, 1,0,0, 0,5,0, 0,0,5 ],
   [   8, 0, 2, 0,15 ],
   [   8, 0, 2, 1,5, 0,30 ],
   [  10, 1, 1, 1,0,0, 0,2,-2 ],
   [  12, 0, 2, 0,10 ],
   [  12, 0, 2, 1,5, 0,20 ],
   [  12, 0, 2, 1,0, 0,20 ],
   [  15, 0, 2, 0,8 ],
   [  16, 0, 2, 1,0, 0,15 ],
   [  20, 1, 1, 1,0,0, 0,5,5, 0,2,-2 ],
   [  20, 1, 1, 1,5,0, 0,5,5, 0,2,-2 ],
   [  20, 1, 2, 0,6 ],
   [  24, 0, 2, 1,0, 0,10 ],
   [  24, 0, 2, 0,5 ],
   [  24, 0, 2, 1,5, 0,10 ],
   [  24, 0, 3, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0 ],
   [  30, 0, 2, 0,4 ],
   [  30, 0, 2, 1,0, 0,8 ],
   [  40, 1, 1, 1,0,0, 0,5,0, 0,0,5, 0,2,2 ],
   [  40, 1, 1, 1,0,0, 0,5,0, 0,0,5, 0,2,-2 ],
   [  40, 0, 2, 1,5, 0,6 ],
   [  40, 0, 2, 0,3 ],
   [  48, 0, 2, 1,0, 0,5 ],
   [  48, 0, 3, 1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0 ],
   [  50, 1, 1, 1,0,0, 0,2,-2, 0,2,2 ],
   [  60, 0, 2, 1,0, 0,4 ],
   [  60, 0, 2, 1,5, 0,4 ],
   [  60, 0, 2, 0,2 ],
   [  80, 0, 2, 1,0, 0,3 ],
   [ 100, 1, 1, 1,0,0, 0,5,5, 0,2,-2, 0,2,2 ],
   [ 100, 1, 1, 1,5,0, 0,5,5, 0,2,-2, 0,2,2 ],
   [ 120, 0, 2, 1,0, 0,2 ],
   [ 120, 0, 2, 0,1 ],
   [ 120, 0, 2, 1,5, 0,2 ],
   [ 120, 0, 3, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0, 0,0,0,0,2 ],
   [ 200, 1, 1, 1,0,0, 0,5,0, 0,0,5, 0,2,-2, 0,2,2 ],
   [ 240, 0, 2, 1,0, 0,1 ],
   [ 240, 0, 3, 1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0, 0,0,0,0,2 ]],
  [], # GL(2,12)
  [   # GL(2,13)
   [   6, 1, 1, 1,0,0, 0,4,-4 ],
   [   7, 0, 2, 0,24 ],
   [   8, 1, 1, 1,0,0, 0,3,-3 ],
   [   8, 1, 1, 1,6,0, 0,3,-3 ],
   [   8, 1, 2, 0,21 ],
   [  12, 1, 1, 1,0,0, 0,6,6, 0,4,-4 ],
   [  12, 1, 1, 1,6,0, 0,6,6, 0,4,-4 ],
   [  14, 0, 2, 0,12 ],
   [  14, 0, 2, 1,0, 0,24 ],
   [  16, 1, 1, 1,0,0, 0,3,-3, 0,3,3 ],
   [  16, 1, 1, 1,3,0, 0,3,-3, 0,3,3 ],
   [  18, 1, 1, 1,0,0, 0,4,-4, 0,4,4 ],
   [  21, 0, 2, 0,8 ],
   [  24, 1, 1, 1,6,0, 0,3,-3, 0,4,4 ],
   [  24, 1, 1, 1,0,0, 0,3,-3, 0,4,-4 ],
   [  24, 1, 1, 1,6,0, 0,3,-3, 0,4,-4 ],
   [  24, 1, 1, 1,0,0, 0,3,-3, 0,4,4 ],
   [  24, 1, 1, 1,0,0, 0,3,3, 0,4,-4 ],
   [  24, 1, 1, 1,3,0, 0,3,3, 0,4,-4 ],
   [  24, 1, 2, 0,7 ],
   [  24, 0, 4, 0,1,0,0,4, 0,0,1,0,0, 0,0,0,1,0 ],
   [  24, 0, 4, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0 ],
   [  28, 0, 2, 0,6 ],
   [  28, 0, 2, 1,6, 0,12 ],
   [  28, 0, 2, 1,0, 0,12 ],
   [  32, 1, 1, 1,0,0, 0,3,0, 0,0,3 ],
   [  36, 1, 1, 1,0,0, 0,6,6, 0,4,-4, 0,4,4 ],
   [  36, 1, 1, 1,6,0, 0,6,6, 0,4,-4, 0,4,4 ],
   [  42, 0, 2, 0,4 ],
   [  42, 0, 2, 1,0, 0,8 ],
   [  48, 1, 1, 1,0,0, 0,3,-3, 0,3,3, 0,4,-4 ],
   [  48, 1, 1, 1,3,0, 0,3,-3, 0,3,3, 0,4,-4 ],
   [  48, 1, 1, 1,3,0, 0,3,-3, 0,3,3, 0,4,4 ],
   [  48, 1, 1, 1,0,0, 0,3,-3, 0,3,3, 0,4,4 ],
   [  48, 0, 4, 2,0,0,0,0, 0,1,0,0,4, 0,0,1,0,0, 0,0,0,1,0 ],
   [  48, 0, 4, 2,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0 ],
   [  56, 0, 2, 0,3 ],
   [  56, 0, 2, 1,0, 0,6 ],
   [  56, 0, 2, 1,3, 0,6 ],
   [  72, 1, 1, 1,0,0, 0,3,3, 0,4,-4, 0,4,4 ],
   [  72, 1, 1, 1,3,0, 0,3,3, 0,4,-4, 0,4,4 ],
   [  72, 1, 1, 1,6,0, 0,3,-3, 0,4,-4, 0,4,4 ],
   [  72, 1, 1, 1,0,0, 0,3,-3, 0,4,-4, 0,4,4 ],
   [  72, 0, 4, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0, 0,0,0,0,4 ],
   [  84, 0, 2, 1,6, 0,4 ],
   [  84, 0, 2, 1,0, 0,4 ],
   [  84, 0, 2, 0,2 ],
   [  96, 1, 1, 1,0,0, 0,3,0, 0,0,3, 0,4,-4 ],
   [  96, 1, 1, 1,0,0, 0,3,0, 0,0,3, 0,4,4 ],
   [  96, 0, 4, 1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0 ],
   [ 112, 0, 2, 1,0, 0,3 ],
   [ 144, 1, 1, 1,3,0, 0,3,-3, 0,3,3, 0,4,-4, 0,4,4 ],
   [ 144, 1, 1, 1,0,0, 0,3,-3, 0,3,3, 0,4,-4, 0,4,4 ],
   [ 144, 0, 4, 2,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0, 0,0,0,0,4 ],
   [ 168, 0, 2, 0,1 ],
   [ 168, 0, 2, 1,0, 0,2 ],
   [ 168, 0, 2, 1,3, 0,2 ],
   [ 288, 1, 1, 1,0,0, 0,3,0, 0,0,3, 0,4,-4, 0,4,4 ],
   [ 288, 0, 4, 1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0, 0,0,0,0,4 ],
   [ 336, 0, 2, 1,0, 0,1 ]]],
 [   # GL(3,*)
  [], # GL(3,1)
  [   # GL(3,2)
   [   7, 0, 2, 0,1 ],
   [  21, 0, 2, 1,0, 0,1 ]],
  [   # GL(3,3)
   [  12, 1, 1, 0,1,0,0,0, 0,0,1,0,1, 0,0,0,1,1 ],
   [  13, 0, 2, 0,2 ],
   [  24, 1, 1, 1,0,1,1,1, 0,1,0,0,0, 0,0,1,0,1, 0,0,0,1,1 ],
   [  24, 1, 1, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0, 0,0,0,0,1 ],
   [  24, 1, 1, 1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,1, 0,0,0,1,1 ],
   [  26, 0, 2, 0,1 ],
   [  39, 0, 2, 1,0, 0,2 ],
   [  48, 1, 1, 1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0, 0,0,0,0,1 ],
   [  78, 0, 2, 1,0, 0,1 ]],
  [], # GL(3,4)
  [   # GL(3,5)
   [  12, 1, 1, 0,1,0,0,0, 0,0,2,0,-2, 0,0,0,2,-2 ],
   [  24, 1, 1, 1,0,0,0,0, 0,1,0,0,0, 0,0,2,0,-2, 0,0,0,2,-2 ],
   [  24, 1, 1, 1,0,2,2,2, 0,1,0,0,0, 0,0,2,0,-2, 0,0,0,2,-2 ],
   [  24, 1, 1, 0,1,0,0,0, 0,0,2,0,-2, 0,0,0,2,-2, 0,0,2,2,2 ],
   [  31, 0, 2, 0,4 ],
   [  48, 1, 1, 0,1,0,0,0, 0,0,2,0,-2, 0,0,0,2,-2, 0,0,1,1,1 ],
   [  48, 1, 1, 1,0,3,3,3, 0,1,0,0,0, 0,0,2,0,-2, 0,0,0,2,-2 ],
   [  48, 1, 1, 0,1,0,0,0, 0,0,1,0,-1, 0,0,0,1,-1 ],
   [  48, 1, 1, 1,0,2,2,2, 0,1,0,0,0, 0,0,2,0,-2, 0,0,0,2,-2, 0,0,2,2,2 ],
   [  62, 0, 2, 0,2 ],
   [  93, 0, 2, 1,0, 0,4 ],
   [  96, 1, 1, 1,0,2,2,2, 0,1,0,0,0, 0,0,2,0,-2, 0,0,0,2,-2, 0,0,1,1,1 ],
   [  96, 1, 1, 0,1,0,0,0, 0,0,1,0,-1, 0,0,0,1,-1, 0,0,2,2,2 ],
   [  96, 1, 1, 1,0,2,2,2, 0,1,0,0,0, 0,0,1,0,-1, 0,0,0,1,-1 ],
   [  96, 1, 1, 1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,-1, 0,0,0,1,-1 ],
   [ 124, 0, 2, 0,1 ],
   [ 186, 0, 2, 1,0, 0,2 ],
   [ 192, 1, 1, 1,0,3,3,3, 0,1,0,0,0, 0,0,1,0,-1, 0,0,0,1,-1 ],
   [ 192, 1, 1, 0,1,0,0,0, 0,0,1,0,-1, 0,0,0,1,-1, 0,0,1,1,1 ],
   [ 192, 1, 1, 1,0,2,2,2, 0,1,0,0,0, 0,0,1,0,-1, 0,0,0,1,-1, 0,0,2,2,2 ],
   [ 372, 0, 2, 1,0, 0,1 ],
   [ 384, 1, 1, 1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0, 0,0,0,0,1 ]]],
 [   # GL(4,*)
  [], # GL(4,1)
  [   # GL(4,2)
   [   5, 0, 5, 0,3 ],
   [  10, 0, 5, 2,0, 0,3 ],
   [  15, 0, 5, 0,1 ],
   [  18, 2, 2, 1,0,0,0,0, 0,0,1,0,0, 0,0,0,0,1 ],
   [  20, 0, 5, 1,0, 0,3 ],
   [  30, 0, 5, 2,0, 0,1 ],
   [  36, 2, 2, 1,0,0,0,0, 0,1,0,1,0, 0,0,1,0,0, 0,0,0,0,1 ],
   [  36, 2, 2, 1,1,0,0,0, 0,0,1,0,0, 0,0,0,0,1 ],
   [  60, 0, 5, 1,0, 0,1 ],
   [  72, 2, 2, 1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0, 0,0,0,0,1 ]],
  [   # GL(4,3)
   [   5, 0, 5, 0,64 ],
   [  10, 0, 5, 0,64, 2,16 ],
   [  10, 0, 5, 0,64, 0,40 ],
   [  16, 1, 1, 1,2,1,1,1,0,0,0, 1,2,1,0,1,0,1,1 ],
   [  16, 1, 1, 1,1,1,0,1,1,1,0, 1,1,1,0,0,1,0,0 ],
   [  16, 1, 1, 0,0,0,1,1,0,1,0, 0,0,1,1,0,1,1,0, 0,0,1,1,1,1,0,0 ],
   [  16, 2, 2, 1,1,0,1,3 ],
   [  16, 2, 2, 1,0,0,1,1, 0,1,7,0,6 ],
   [  20, 0, 5, 0,64, 2,16, 2,40 ],
   [  20, 0, 5, 2,76, 2,12 ],
   [  20, 0, 5, 0,60, 0,64 ],
   [  20, 0, 5, 3,44, 3,76 ],
   [  32, 1, 1, 1,0,1,1,1,1,0,1, 1,0,1,0,0,0,1,0 ],
   [  32, 1, 1, 1,1,1,0,0,1,0,1, 1,1,1,0,1,1,1,1, 1,1,0,0,0,0,1,1 ],
   [  32, 1, 1, 1,0,1,1,1,1,0,1, 1,0,1,0,1,0,0,0, 1,0,0,1,1,1,0,1 ],
   [  32, 1, 1, 0,0,0,1,1,0,1,0, 0,0,1,0,0,1,0,1, 0,0,1,1,0,1,1,0,
                0,0,0,1,0,1,1,0 ],
   [  32, 1, 1, 1,0,1,1,1,1,0,1, 1,0,1,0,1,0,0,0, 0,0,1,1,0,1,1,0 ],
   [  32, 2, 2, 1,1,3,0,6, 1,0,6,1,7, 1,0,0,1,1 ],
   [  32, 2, 2, 1,0,5,0,1, 0,0,5,0,1, 1,1,6,1,2 ],
   [  32, 2, 2, 1,0,5,0,1, 1,0,7,0,7, 1,0,0,0,6 ],
   [  32, 2, 2, 1,1,5,1,7, 0,0,3,0,1, 1,0,6,0,6 ],
   [  32, 2, 2, 1,0,6,0,6, 1,1,7,1,7, 1,1,5,1,5, 1,0,4,0,0 ],
   [  32, 2, 2, 1,0,5,0,1, 1,0,7,0,7, 0,0,5,0,1 ],
   [  32, 2, 2, 1,1,0,1,3, 1,1,3,1,0 ],
   [  40, 0, 5, 0,70, 0,64 ],
   [  40, 0, 5, 3,44, 3,52 ],
   [  40, 0, 5, 2,66, 2,62 ],
   [  40, 0, 5, 2,76, 2,12, 0,60 ],
   [  40, 0, 5, 3,39, 3,7 ],
   [  48, 2, 3, 1,1,0,1,3,1,0,0,0, 1,1,2,0,3,1,2,0,3 ],
   [  48, 2, 3, 1,1,2,1,3,1,2,0,1, 0,0,0,0,3,0,0,1,3, 0,0,0,1,3,0,0,0,1,
                0,0,2,0,3,0,1,0,1 ],
   [  64, 1, 1, 1,1,1,0,1,1,1,0, 1,1,1,0,0,1,0,0, 1,1,0,1,0,1,0,0,
                1,1,0,0,0,0,1,1 ],
   [  64, 1, 1, 1,1,1,0,0,1,0,1, 1,1,1,0,1,1,1,1, 1,1,1,0,1,0,0,1,
                0,0,0,1,0,1,1,1 ],
   [  64, 1, 1, 1,0,1,1,1,1,0,1, 1,0,1,0,0,0,1,0, 1,0,0,1,1,1,0,1 ],
   [  64, 1, 1, 1,0,1,0,0,0,1,1, 1,0,1,0,1,1,0,0, 1,0,1,0,1,1,1,1,
                1,0,1,0,1,0,0,1, 1,0,0,1,1,0,0,1 ],
   [  64, 2, 2, 1,1,0,1,3, 1,1,0,1,1 ],
   [  64, 2, 2, 1,1,7,0,0, 1,0,2,1,5, 1,1,5,1,7 ],
   [  64, 2, 2, 1,0,7,0,2, 1,0,1,0,0, 0,1,4,1,3 ],
   [  64, 2, 2, 1,0,5,0,1, 1,0,7,0,7, 1,0,0,0,6, 0,0,5,0,1 ],
   [  64, 2, 2, 1,1,5,1,7, 1,1,3,1,5, 1,0,5,0,1, 1,1,6,1,0 ],
   [  64, 2, 2, 1,1,0,1,3, 1,1,3,1,0, 1,0,5,0,1 ],
   [  64, 2, 2, 1,0,5,0,1, 1,0,7,0,7, 0,0,5,0,1, 1,1,6,1,2 ],
   [  64, 2, 2, 1,1,3,0,6, 1,0,6,1,7, 1,0,0,1,1, 0,1,7,0,6 ],
   [  80, 0, 5, 2,27, 2,75 ],
   [  80, 0, 5, 2,66, 2,62, 0,70 ],
   [  80, 0, 5, 3,44, 3,52, 3,48 ],
   [  80, 0, 5, 0,75, 0,64 ],
   [  80, 0, 5, 3,39, 3,35 ],
   [  96, 1, 1, 0,0,0,1,1,0,1,0, 0,0,1,0,0,1,0,1, 0,0,1,1,0,1,1,0,
                0,0,0,1,0,1,1,0, 0,1,1,0,1,0,0,1 ],
   [  96, 2, 3, 1,0,1,0,3,0,2,1,3, 1,0,2,0,1,0,1,0,0, 0,1,2,1,3,1,2,1,1 ],
   [  96, 2, 3, 1,1,0,1,0,1,0,1,0, 1,1,0,0,3,1,0,0,1, 1,1,2,0,3,1,2,0,3 ],
   [  96, 2, 3, 1,1,1,1,3,1,1,1,0, 1,1,1,0,3,1,1,0,1, 1,1,1,1,2,1,1,1,1,
                1,1,1,0,2,1,1,0,0, 0,0,2,1,2,0,1,0,1 ],
   [  96, 2, 3, 1,0,1,1,0,0,2,1,2, 1,0,2,0,3,0,1,0,0, 0,1,0,1,0,1,1,1,2 ],
   [  96, 0, 6, 0,3,0,0,1,1, 0,3,0,0,0,1, 0,3,0,0,1,2, 0,0,0,2,1,2 ],
   [  96, 0, 6, 0,0,0,0,1,1, 0,0,0,0,1,2, 1,3,0,0,0,0,
                1,1,0,0,0,0, 0,0,0,2,1,2 ],
   [  96, 0, 6, 1,3,1,1,1,2, 1,1,1,1,1,2, 1,3,1,2,0,1 ],
   [  96, 0, 6, 0,3,1,1,0,3, 0,3,1,2,1,0, 0,3,1,1,0,2 ],
   [ 128, 1, 1, 1,1,1,0,1,1,1,0, 1,1,1,0,0,1,0,0, 1,1,0,1,0,1,0,0,
                1,1,1,0,0,1,0,1, 1,1,0,0,0,0,1,1 ],
   [ 128, 2, 2, 1,1,5,1,7, 1,1,3,1,5, 1,0,5,0,1, 1,1,6,1,0, 1,0,0,0,6 ],
   [ 128, 2, 2, 0,0,5,0,1, 0,0,7,0,1, 1,1,6,0,4 ],
   [ 128, 2, 2, 1,1,7,0,0, 1,0,2,1,5, 1,1,3,0,6, 1,0,7,1,2 ],
   [ 128, 2, 2, 1,0,7,0,2, 1,1,0,1,3 ],
   [ 128, 2, 2, 1,0,7,1,2, 1,1,0,0,3, 1,0,1,1,6, 1,1,5,1,7 ],
   [ 128, 2, 2, 1,1,6,1,0, 1,1,2,1,0, 1,0,0,0,6, 0,1,1,0,5 ],
   [ 128, 2, 2, 1,1,0,1,3, 1,1,0,1,1, 1,0,5,0,1 ],
   [ 128, 2, 2, 1,1,7,0,0, 1,0,2,1,5, 1,1,3,0,6, 1,1,5,1,7 ],
   [ 128, 2, 2, 1,1,0,1,3, 1,1,0,1,1, 1,1,5,1,7 ],
   [ 160, 0, 5, 2,66, 2,62, 0,70, 3,50 ],
   [ 160, 0, 5, 3,39, 3,35, 3,21 ],
   [ 160, 0, 5, 2,27, 2,75, 0,75 ],
   [ 160, 0, 8, 0,0,0,0,1,0,1, 0,0,0,1,1,0,0, 0,0,1,0,1,1,1,
                0,0,0,0,1,1,0, 0,4,0,0,0,1,0 ],
   [ 192, 1, 1, 0,0,0,1,0,1,1,1, 0,0,1,1,0,1,1,1, 0,0,1,0,1,1,0,1,
                0,1,1,0,1,0,0,1 ],
   [ 192, 1, 1, 1,0,1,1,1,1,0,1, 1,0,1,0,0,0,1,0, 1,2,1,1,1,0,0,0 ],
   [ 192, 1, 1, 1,1,1,0,0,1,0,1, 1,1,1,0,1,1,1,1, 1,2,1,1,1,1,1,1 ],
   [ 192, 2, 3, 1,0,2,1,1,0,1,0,1, 1,0,2,1,1,0,1,0,3, 1,0,1,1,0,0,2,1,2,
                0,1,0,1,0,1,1,1,0 ],
   [ 192, 0, 6, 1,2,1,1,1,2, 1,0,1,1,1,0, 1,2,1,2,0,1, 0,3,1,1,0,3 ],
   [ 192, 0, 6, 1,3,1,1,1,2, 1,1,1,1,1,2, 1,3,1,2,0,1, 0,3,1,1,0,3 ],
   [ 192, 0, 6, 1,3,1,1,1,2, 1,1,1,1,1,2, 1,3,1,2,0,1, 1,2,1,1,1,2 ],
   [ 192, 0, 6, 0,3,0,0,1,1, 0,3,0,0,0,1, 0,3,0,0,1,2,
                1,2,0,0,1,1, 0,0,0,2,1,2 ],
   [ 192, 0, 6, 0,3,1,1,0,3, 0,3,1,2,1,0, 0,3,1,1,0,2, 0,2,1,1,1,2 ],
   [ 192, 0, 6, 1,3,1,1,1,2, 1,1,1,1,1,2, 1,3,1,2,0,1, 0,2,1,1,1,2 ],
   [ 256, 2, 2, 1,1,7,0,0, 1,0,2,1,5, 1,1,3,0,6, 1,0,7,1,2, 1,1,5,1,7 ],
   [ 256, 2, 2, 1,1,5,1,7, 1,1,3,1,5, 1,0,5,0,1,
                1,1,6,1,0, 1,0,0,0,6, 0,1,1,0,5 ],
   [ 256, 2, 2, 1,0,7,0,2, 1,1,0,1,3, 0,1,4,0,7 ],
   [ 256, 2, 2, 1,1,7,0,0, 1,0,2,1,5, 1,1,3,0,6, 1,0,7,1,2, 0,0,2,0,7 ],
   [ 256, 2, 2, 1,0,7,0,2, 1,1,0,1,3, 1,1,5,1,7 ],
   [ 256, 2, 2, 1,0,7,0,2, 1,1,0,1,3, 1,1,7,0,0 ],
   [ 288, 0, 7, 0,0,0,0,0,0,0,1,3, 0,0,0,1,1,0,0,0,2, 0,0,0,0,0,0,0,0,3,
                0,0,0,0,1,0,0,0,2, 0,0,2,1,0,0,1,0,3, 0,0,1,0,1,0,1,0,1 ],
   [ 320, 0, 5, 1,0, 0,1 ],
   [ 320, 0, 8, 2,1,1,0,1,1,1, 2,3,0,1,1,0,1 ],
   [ 384, 1, 1, 1,0,0,0,0,0,0,0, 0,1,0,0,0,0,0,0, 0,0,1,0,0,0,0,0,
                0,0,0,1,0,0,0,0, 0,0,0,0,1,0,0,0, 0,0,0,0,0,1,0,0,
                0,0,0,0,0,0,1,0, 0,0,0,0,0,0,0,1 ],
   [ 384, 2, 3, 1,1,1,1,3,1,1,0,1, 1,1,1,1,1,1,1,0,1, 1,1,1,1,3,1,1,1,1,
                1,1,1,1,0,1,1,0,1, 0,0,2,1,2,0,1,0,1 ],
   [ 384, 2, 3, 1,0,0,1,0,0,0,0,3, 1,0,0,0,3,0,0,1,2, 1,0,0,1,1,0,0,0,0,
                1,0,2,1,1,0,1,0,1 ],
   [ 384, 0, 6, 1,0,0,0,0,0, 0,1,0,0,0,0, 0,0,1,0,0,0,
                0,0,0,1,0,0, 0,0,0,0,1,0, 0,0,0,0,0,1 ],
   [ 512, 2, 2, 1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0, 0,0,0,0,1 ],
   [ 576, 0, 7, 0,1,1,0,1,1,1,1,2, 0,1,1,1,0,1,1,0,3, 0,1,2,1,0,1,1,1,0,
                0,1,1,0,1,1,2,0,1 ],
   [ 576, 0, 7, 1,0,0,1,0,0,0,0,3, 1,0,0,0,1,0,0,1,0, 1,0,0,1,1,0,0,0,0,
                1,0,2,1,1,0,1,0,1, 0,0,1,0,1,0,1,0,1 ],
   [ 576, 0, 7, 0,1,1,1,0,0,0,1,3, 0,1,2,0,1,0,0,1,1, 0,1,1,1,0,0,0,0,3,
                0,1,1,1,0,0,0,1,0, 0,0,2,1,0,0,1,0,3 ],
   [ 640, 0, 8, 1,0,0,0,0,0,0, 0,1,0,0,0,0,0, 0,0,1,0,0,0,0,
                0,0,0,1,0,0,0, 0,0,0,0,1,0,0, 0,0,0,0,0,1,0,
                0,0,0,0,0,0,1 ],
   [ 768, 2, 3, 1,1,0,1,0,1,0,1,0, 1,0,0,1,0,0,0,0,3, 1,0,0,1,1,0,0,0,0,
                1,1,0,1,1,1,0,0,0, 1,1,2,1,3,1,2,1,0 ],
   [1152, 2, 3, 1,0,0,1,0,0,0,0,3, 1,0,0,0,3,0,0,1,2, 1,0,0,1,1,0,0,0,0,
                1,0,2,1,1,0,1,0,1, 0,0,1,0,1,0,1,0,1 ],
   [1152, 0, 7, 0,1,1,0,1,1,1,1,2, 0,1,1,1,0,1,1,0,3, 0,1,2,1,0,1,1,1,0,
                0,1,1,0,1,1,2,0,1, 0,1,1,1,0,0,0,1,3 ],
   [1152, 0, 7, 0,1,1,0,1,1,1,1,2, 0,1,1,1,0,1,1,0,3, 0,1,2,1,0,1,1,1,0,
                0,1,1,0,1,1,2,0,1, 1,1,0,1,0,1,0,1,0 ],
   [1152, 0, 7, 0,1,1,0,1,1,1,1,2, 0,1,1,1,0,1,1,0,3, 0,1,2,1,0,1,1,1,0,
                0,1,1,0,1,1,2,0,1, 1,0,0,0,0,1,1,1,1 ],
   [2304, 2, 3, 1,0,0,0,0,1,1,1,1, 1,1,1,0,0,0,0,1,2, 1,1,0,1,3,0,1,0,3 ],
   [2304, 2, 3, 1,1,0,1,0,1,0,1,0, 1,0,0,1,0,0,0,0,3, 1,0,0,1,1,0,0,0,0,
                1,1,0,1,1,1,0,0,0, 1,1,2,1,3,1,2,1,0, 1,0,2,1,1,0,1,0,1 ],
   [2304, 0, 7, 1,0,0,0,0,0,0,0,0, 0,1,0,0,0,0,0,0,0, 0,0,1,0,0,0,0,0,0,
                0,0,0,1,0,0,0,0,0, 0,0,0,0,1,0,0,0,0, 0,0,0,0,0,1,0,0,0,
                0,0,0,0,0,0,1,0,0, 0,0,0,0,0,0,0,1,0, 0,0,0,0,0,0,0,0,1 ],
   [4608, 2, 3, 1,0,0,0,0,0,0,0,0, 0,1,0,0,0,0,0,0,0, 0,0,1,0,0,0,0,0,0,
                0,0,0,1,0,0,0,0,0, 0,0,0,0,1,0,0,0,0, 0,0,0,0,0,1,0,0,0,
                0,0,0,0,0,0,1,0,0, 0,0,0,0,0,0,0,1,0, 0,0,0,0,0,0,0,0,1 ]]],
 [   # GL(5,*)
  [], # GL(5,1)
  [   # GL(5,2)
   [  31, 0, 2, 0,1 ],
   [ 155, 0, 2, 1,0, 0,1 ]],
  [   # GL(5,3)
   [  11, 0, 2, 0,22 ],
   [  22, 0, 2, 0,11 ],
   [  55, 0, 2, 1,0, 0,22 ],
   [  80, 1, 1, 0,1,0,0,0,0,0, 0,0,1,1,0,0,0, 0,0,0,1,1,0,0,
                0,0,0,0,1,1,0, 0,0,0,0,0,1,1 ],
   [ 110, 0, 2, 1,0, 0,11 ],
   [ 121, 0, 2, 0,2 ],
   [ 160, 1, 1, 0,1,0,0,0,0,0, 0,0,1,1,0,0,0, 0,0,0,1,1,0,0,
                0,0,0,0,1,1,0, 0,0,0,0,0,1,1, 0,0,1,1,1,1,1 ],
   [ 160, 1, 1, 2,0,0,0,0,0,0, 0,1,0,0,0,0,0, 0,0,1,1,0,0,0,
                0,0,0,1,1,0,0, 0,0,0,0,1,1,0, 0,0,0,0,0,1,1 ],
   [ 160, 1, 1, 2,0,1,1,1,1,1, 0,1,0,0,0,0,0, 0,0,1,1,0,0,0,
                0,0,0,1,1,0,0, 0,0,0,0,1,1,0, 0,0,0,0,0,1,1 ],
   [ 242, 0, 2, 0,1 ],
   [ 320, 1, 1, 1,0,0,0,0,0,0, 0,1,0,0,0,0,0, 0,0,1,1,0,0,0,
                0,0,0,1,1,0,0, 0,0,0,0,1,1,0, 0,0,0,0,0,1,1 ],
   [ 320, 1, 1, 2,0,0,0,0,0,0, 0,1,0,0,0,0,0, 0,0,1,1,0,0,0,
                0,0,0,1,1,0,0, 0,0,0,0,1,1,0, 0,0,0,0,0,1,1,
                0,0,1,1,1,1,1 ],
   [ 320, 1, 1, 1,0,1,1,1,1,1, 0,1,0,0,0,0,0, 0,0,1,1,0,0,0,
                0,0,0,1,1,0,0, 0,0,0,0,1,1,0, 0,0,0,0,0,1,1 ],
   [ 605, 0, 2, 1,0, 0,2 ],
   [ 640, 1, 1, 1,0,0,0,0,0,0, 0,1,0,0,0,0,0, 0,0,1,0,0,0,0,
                0,0,0,1,0,0,0, 0,0,0,0,1,0,0, 0,0,0,0,0,1,0,
                0,0,0,0,0,0,1 ],
   [1210, 0, 2, 1,0, 0,1 ]]],
 [   # GL(6,*)
  [], # GL(6,1)
  [   # GL(6,2)
   [   9, 2, 3, 0,1,1,1,0,0,1,0 ],
   [  14, 3, 6, 0,0,6,0,2, 1,2,5,1,4 ],
   [  18, 2, 3, 0,1,1,1,0,0,1,0, 1,1,0,1,1,1,0,2 ],
   [  21, 0, 8, 0,54, 0,42 ],
   [  27, 2, 3, 0,2,0,0,0,0,0,1, 0,2,0,0,0,1,0,0 ],
   [  27, 2, 3, 0,2,0,2,1,2,1,1, 0,2,0,1,1,1,1,2, 0,2,0,2,1,0,1,2 ],
   [  42, 3, 6, 0,0,6,0,2, 0,1,1,1,1, 1,2,5,1,4 ],
   [  42, 0, 8, 0,54, 0,42, 3,14 ],
   [  54, 2, 3, 0,2,0,2,1,2,1,1, 0,2,0,1,1,1,1,2, 0,2,0,2,1,0,1,2,
                1,2,0,0,1,2,1,2 ],
   [  54, 2, 3, 0,2,0,2,1,2,1,1, 0,2,0,1,1,1,1,2, 0,2,0,2,1,0,1,2,
                1,1,0,2,1,1,0,1 ],
   [  54, 2, 3, 0,1,1,1,0,0,1,0, 0,1,1,0,0,0,1,2, 1,1,0,1,1,1,0,2 ],
   [  63, 0, 8, 0,56, 0,54 ],
   [  63, 0, 8, 0,54, 4,30, 4,27 ],
   [  63, 0, 8, 4,38, 4,11 ],
   [  81, 2, 3, 0,1,1,1,0,0,1,0, 0,1,1,0,0,0,1,2, 0,2,0,1,1,1,1,1 ],
   [  98, 3, 6, 0,0,6,0,2, 0,0,5,0,1, 1,2,5,1,4 ],
   [ 108, 2, 3, 0,2,0,2,1,2,1,1, 0,2,0,1,1,1,1,2, 0,2,0,2,1,0,1,2,
                1,1,0,1,1,1,0,2, 0,0,1,1,1,1,1,2 ],
   [ 108, 0,11, 0,0,1,3,1,0,2, 0,0,1,3,2,1,0 ],
   [ 126, 0, 8, 0,54, 4,30, 4,27, 3,14 ],
   [ 126, 0, 8, 0,56, 0,54, 3,14 ],
   [ 162, 2, 3, 0,1,1,1,0,0,1,0, 0,1,1,0,0,0,1,2, 0,2,0,1,1,1,1,1,
                1,2,0,0,1,2,1,2 ],
   [ 162, 2, 3, 0,1,1,1,0,0,1,0, 0,1,1,0,0,0,1,2, 0,2,0,1,1,1,1,1,
                0,0,1,1,1,1,1,1 ],
   [ 162, 2, 3, 0,2,0,0,0,0,0,1, 0,1,0,1,0,0,0,0, 1,1,1,2,1,1,1,2 ],
   [ 189, 0, 8, 4,38, 4,11, 4,19 ],
   [ 216, 0,11, 0,0,1,3,1,0,2, 0,0,1,3,2,1,0, 0,0,1,2,0,2,1 ],
   [ 216, 0,11, 1,0,0,3,1,2,2, 1,0,1,0,1,0,0 ],
   [ 216, 0,11, 0,0,1,2,0,2,1, 0,0,1,0,1,1,2, 1,2,0,2,1,2,0 ],
   [ 294, 3, 6, 0,0,6,0,2, 0,0,5,0,1, 0,1,1,1,1,
                1,2,5,1,4 ],
   [ 294, 3, 6, 0,0,6,0,2, 0,0,5,0,1, 0,2,3,1,1,
                1,2,5,1,4 ],
   [ 324, 2, 3, 0,1,1,1,0,0,1,0, 0,1,1,0,0,0,1,2, 0,2,0,1,1,1,1,1,
                1,1,0,2,1,1,0,1, 0,0,1,1,1,1,1,1 ],
   [ 324, 2, 3, 0,1,1,1,0,0,1,0, 0,1,0,1,1,0,1,0 ],
   [ 378, 0, 8, 1,0, 0,1 ],
   [ 432, 0,11, 1,2,0,1,1,0,0, 1,2,0,1,1,2,0, 0,0,1,3,1,0,2 ],
   [ 648, 2, 3, 0,1,1,1,0,0,1,0, 0,1,0,1,1,0,1,0, 0,0,1,1,1,1,1,1 ],
   [ 648, 2, 3, 0,1,1,1,0,0,1,0, 0,1,0,1,1,0,1,0, 1,1,1,1,0,0,0,0 ],
   [ 648, 2, 3, 0,1,1,1,0,0,1,0, 0,1,0,1,1,0,1,0, 1,0,0,0,1,1,1,1 ],
   [ 648, 0,11, 0,2,1,2,1,1,0, 0,1,1,1,2,0,1 ],
   [ 882, 3, 6, 1,0,0,0,0, 0,1,0,0,0, 0,0,1,0,0, 0,0,0,1,0, 0,0,0,0,1 ],
   [1296, 2, 3, 1,0,0,0,0,0,0,0, 0,1,0,0,0,0,0,0, 0,0,1,0,0,0,0,0,
                0,0,0,1,0,0,0,0, 0,0,0,0,1,0,0,0, 0,0,0,0,0,1,0,0,
                0,0,0,0,0,0,1,0, 0,0,0,0,0,0,0,1 ],
   [1296, 0,11, 1,0,0,0,0,0,0, 0,1,0,0,0,0,0, 0,0,1,0,0,0,0,
                0,0,0,1,0,0,0, 0,0,0,0,1,0,0, 0,0,0,0,0,1,0,
                0,0,0,0,0,0,1 ]]],
 [   # GL(7,*)
  [], # GL(7,1)
  [   # GL(7,2)
   [ 127, 0, 2, 0,1 ],
   [ 889, 0, 2, 1,0, 0,1 ]]]];


#############################################################################
##
#F  IrreducibleSolvableGroup(<n>,<p>,<k>) . . . . . . . . extraction function
##
IrreducibleSolvableGroup := function ( n, p, k )
    local
        desc,          # compact description of group
        guard,         # number of guardian of group
        gdgens,        # list of generators for that guardian
        len,           # length of this list
        numgen,        # number of generators of the group
        pos,           # marks position in desc where next normal form begins
        i, j,          # loop variables
        gens,          # the generators of the group
        idmat,         # the identity matrix of GL(n,p)
        mat,           # evolves from idmat into a generator of the group
        grp;           # group to be returned

    # Check for sensible input
    if not (n > 1 and p in Primes and p^n < 256) then
        Error( "n must be > 1, p must be prime, and p^n must be < 256" );
    fi;
    if k > Length( IrredSolGroupList[ n ][ p ] ) then
        Error( "there is no k-th group for this n and p" );
    fi;

    # Pick out a few important pieces of information
    desc  := IrredSolGroupList[ n ][ p ][ k ];
    gdgens := IrredSolJSGens[ n ][ p ][ desc[3] ];
    len := Length( gdgens );

    # Construct the generators
    gens := [ ];
    idmat := IdentityMat( n, GF( p ) );
    for i in [1..(Length(desc)-3)/len] do
        mat := idmat;
        for j in [1..len] do
            mat := mat * ( gdgens[ j ] ^ desc[ 3 + len*(i-1) + j ] );
        od;
        gens[ i ] := mat;
    od;

    # Make the group and return it
    grp := Group( gens, idmat );
    grp.size := desc[ 1 ];
    if desc[ 2 ] = 0 then
        grp.isLinearlyPrimitive := true;
    else
        grp.isLinearlyPrimitive := false;
        grp.minimalBlockDimension := desc[ 2 ];
    fi;
    return grp;

end; # IrreducibleSolvableGroup( n, p, k )


#############################################################################
##
#F  IsLinearlyPrimitive(<G>)  . . . . . . . . . is a group linearly primitive
#F  MinimalBlockDimension(<G>)  . . . . . . . . . . . minimal block dimension
##
##  These functions are just dummy functions to be used as property functions
##  for the selection and the example function of the IrredSol group library.
##
IsLinearlyPrimitive := function ( G )
    if not IsGroup( G )  then
        Error("<G> must be a group");
    fi;
    if not IsBound( G.isLinearlyPrimitive )  then
        Error("sorry, cannot decide if <G> is linearly primitive");
    fi;
    return G.isLinearlyPrimitive;
end;

MinimalBlockDimension := function ( G )
    if not IsGroup( G )  then
        Error("<G> must be a group");
    fi;
    if not IsBound( G.minimalBlockDimension )  then
        Error("sorry, cannot compute the minimal block dimension");
    fi;
    return G.minimalBlockDimension;
end;
    

#############################################################################
##
#F  AllIrreducibleSolvableGroups(...)  select all irreducible solvable groups
##
AllIrreducibleSolvableGroups := function ( arg )
    local
        dims,            # dimensions
        chars,           # characteristics
        sizes,           # sizes
        linprim,         # linearly primitive flag
        minblockdims,    # minimal block dimensions
        funs,            # other functions requested by caller
        vals,            # their values
        i,               # counter through arg
        nppairs,         # (n,p) pairs such that p^n < 256
        np,              # counter through nppairs
        n,               # n
        p,               # p
        grplist,         # list of groups to be returned
        k,               # counter through group descriptions for GL(n,p)
        desc,            # compact description of the kth group in GL(n,p)
        gp,              # the group itself
        passtest;        # boolean flag

    # Initialize a few things
    funs := [ ];
    vals := [ ];

    # Loop through the arguments
    for i in [1..Length(arg)/2] do

        # Special case for Dimension
        if arg[2*i-1] = Dimension then
            if not IsList( arg[2*i] ) then
                arg[2*i] := [ arg[2*i] ];
            fi;
            dims := [ ];
            for n in arg[2*i] do
                if n in [ 2, 3, 4, 5, 6, 7 ] then
                    Add( dims, n );
                else
                    Print( "#W  AllIrreducibleSolvableGroups: ",
                           "n = ", n, " outside range of library\n" );
                fi;
            od;
            if dims = [ ] then
                Error( "all Dimension arguments outside range of library" );
            fi;

        # Special case for CharFFE
        elif arg[2*i-1] = CharFFE then
            if not IsList( arg[2*i] ) then
                arg[2*i] := [ arg[2*i] ];
            fi;
            chars := [ ];
            for p in arg[2*i] do
                if p in [ 2, 3, 5, 7, 11, 13 ] then
                    Add( chars, p );
                else
                    Print( "#W  AllIrreducibleSolvableGroups: ",
                           "p = ", p, " outside range of library\n" );
                fi;
            od;
            if chars = [ ] then
                Error( "all CharFFE arguments outside range of library" );
            fi;

        # Special case for Size
        elif arg[2*i-1] = Size then
            if IsList( arg[2*i] ) then
                sizes := arg[2*i];
            else
                sizes := [ arg[2*i] ];
            fi;

        # Special case for IsLinearlyPrimitive
        elif arg[2*i-1] = IsLinearlyPrimitive then
            if IsBool( arg[2*i] ) then
                linprim := arg[2*i];
            else
                Error( "IsLinearlyPrimitive argument must be boolean" );
            fi;

        # Special case for MinimalBlockDimension
        elif arg[2*i-1] = MinimalBlockDimension then
            if IsList( arg[2*i] ) then
                minblockdims := arg[2*i];
            else
                minblockdims := [ arg[2*i] ];
            fi;

        # General case
        elif IsFunc( arg[2*i-1] ) then
            Add( funs, arg[2*i-1] );
            Add( vals, arg[2*i] );
        else
            Error( "<fun",i,"> must be a function" );
        fi;
    od;

    # Find the allowable (n,p) pairs
    if not IsBound( dims ) and not IsBound( chars ) then
        nppairs := [ [2,2], [2,3], [2,5], [2,7], [2,11], [2,13],
                     [3,2], [3,3], [3,5],
                     [4,2], [4,3],
                     [5,2], [5,3],
                     [6,2],
                     [7,2] ];
    elif IsBound( dims ) and IsBound( chars ) then
        nppairs := [ ];
        for n in dims do
            for p in chars do
                if p^n < 256 then
                    Add( nppairs, [ n, p ] );
                else
                    Print( "#W  AllIrreducibleSolvableGroups: n = ", n,
                           ", p = ", p, " outside range of library\n" );
                fi;
            od;
        od;
        if nppairs = [ ] then
            Error( "none of the specified (n,p) pairs satisfy p^n < 256" );
        fi;
    else
        if not IsBound( dims ) then
            dims := [ 2, 3, 4, 5, 6, 7 ];
        else
            chars := [ 2, 3, 5, 7, 11, 13 ];
        fi;
        nppairs := [ ];
        for n in dims do
            for p in chars do
                if p^n < 256 then
                    Add( nppairs, [ n, p ] );
                fi;
            od;
        od;
    fi;

    # Make the list of groups
    grplist := [ ];

    # Loop through the allowable (n,p) pairs
    for np in nppairs do
        n := np[ 1 ];
        p := np[ 2 ];

        # Loop through the group descriptions
        for k in [1..Length( IrredSolGroupList[ n ][ p ] )] do
            gp := [ ];
            desc := IrredSolGroupList[ n ][ p ][ k ];

            # Check if the description satisfies the special case criteria.
            # If it does, create the group
            if     ( not IsBound( sizes ) or desc[1] in sizes )
               and ( not IsBound( linprim ) or (desc[2] = 0) = linprim )
               and ( not IsBound( minblockdims ) or desc[2] in minblockdims )
            then
                gp := IrreducibleSolvableGroup( n, p, k );
            fi;

            # Now see if the group (if created) satisfies the other criteria.
            # If it does, add it to the list
            if gp <> [ ] then
                passtest := true;
                i := 1;
                while passtest and i <= Length( funs ) do
                    passtest := funs[ i ]( gp ) = vals[ i ]
                                or ( IsList( vals[ i ] )
                                     and funs[ i ]( gp ) in vals[ i ] );
                    i := i + 1;
                od;
                if passtest then
                    Add( grplist, gp );
                fi;
            fi;
        od;
    od;

    return grplist;
end; # AllIrreducibleSolvableGroups( fun1, val1, fun2, val2, ... )
    

#############################################################################
##
#F  OneIrreducibleSolvableGroup(...)   extract one irreducible solvable group
##
OneIrreducibleSolvableGroup := function ( arg )
    local
        dims,            # dimensions
        chars,           # characteristics
        sizes,           # sizes
        linprim,         # linearly primitive flag
        minblockdims,    # minimal block dimensions
        funs,            # other functions requested by caller
        vals,            # their values
        i,               # counter through arg
        nppairs,         # (n,p) pairs such that p^n < 256
        np,              # counter through (n,p) pairs
        n,               # n
        p,               # p
        k,               # counter through group descriptions for GL(n,p)
        desc,            # compact description of the kth group in GL(n,p)
        gp,              # the group to be returned
        passtest;        # boolean flag

    # Initialize a few things
    funs := [ ];
    vals := [ ];

    # Loop through the arguments
    for i in [1..Length(arg)/2] do

        # Special case for Dimension
        if arg[2*i-1] = Dimension then
            if not IsList( arg[2*i] ) then
                arg[2*i] := [ arg[2*i] ];
            fi;
            dims := [ ];
            for n in arg[2*i] do
                if n in [ 2, 3, 4, 5, 6, 7 ] then
                    Add( dims, n );
                else
                    Print( "#W  OneIrreducibleSolvableGroup: ",
                           "n = ", n, " outside range of library\n" );
                fi;
            od;
            if dims = [ ] then
                Error( "all Dimension arguments outside range of library" );
            fi;

        # Special case for CharFFE
        elif arg[2*i-1] = CharFFE then
            if not IsList( arg[2*i] ) then
                arg[2*i] := [ arg[2*i] ];
            fi;
            chars := [ ];
            for p in arg[2*i] do
                if p in [ 2, 3, 5, 7, 11, 13 ] then
                    Add( chars, p );
                else
                    Print( "#W  OneIrreducibleSolvableGroup: ",
                           "p = ", p, " outside range of library\n" );
                fi;
            od;
            if chars = [ ] then
                Error( "all CharFFE arguments outside range of library" );
            fi;

        # Special case for Size
        elif arg[2*i-1] = Size then
            if IsList( arg[2*i] ) then
                sizes := arg[2*i];
            else
                sizes := [ arg[2*i] ];
            fi;

        # Special case for IsLinearlyPrimitive
        elif arg[2*i-1] = IsLinearlyPrimitive then
            if IsBool( arg[2*i] ) then
                linprim := arg[2*i];
            else
                Error( "IsLinearlyPrimitive argument must be boolean" );
            fi;

        # Special case for MinimalBlockDimension
        elif arg[2*i-1] = MinimalBlockDimension then
            if IsList( arg[2*i] ) then
                minblockdims := arg[2*i];
            else
                minblockdims := [ arg[2*i] ];
            fi;

        # General case
        elif IsFunc( arg[2*i-1] ) then
            Add( funs, arg[2*i-1] );
            Add( vals, arg[2*i] );
        else
            Error( "<fun",i,"> must be a function" );
        fi;
    od;

    # Find the allowable (n,p) pairs
    if not IsBound( dims ) and not IsBound( chars ) then
        nppairs := [ [2,2], [2,3], [2,5], [2,7], [2,11], [2,13],
                     [3,2], [3,3], [3,5],
                     [4,2], [4,3],
                     [5,2], [5,3],
                     [6,2],
                     [7,2] ];
    elif IsBound( dims ) and IsBound( chars ) then
        nppairs := [ ];
        for n in dims do
            for p in chars do
                if p^n < 256 then
                    Add( nppairs, [ n, p ] );
                else
                    Print( "#W  OneIrreducibleSolvableGroup: n = ", n,
                           ", p = ", p, " outside range of library\n" );
                fi;
            od;
        od;
        if nppairs = [ ] then
            Error( "none of the specified (n,p) pairs satisfy p^n < 256" );
        fi;
    else
        if not IsBound( dims ) then
            dims := [ 2, 3, 4, 5, 6, 7 ];
        else
            chars := [ 2, 3, 5, 7, 11, 13 ];
        fi;
        nppairs := [ ];
        for n in dims do
            for p in chars do
                if p^n < 256 then
                    Add( nppairs, [ n, p ] );
                fi;
            od;
        od;
    fi;

    # Find the group.
    # Loop through the allowable (n,p) pairs
    for np in nppairs do
        n := np[ 1 ];
        p := np[ 2 ];

        # Loop through the group descriptions
        for k in [1..Length( IrredSolGroupList[ n ][ p ] )] do
            gp := [ ];
            desc := IrredSolGroupList[ n ][ p ][ k ];

            # Check if the description satisfies the special case criteria.
            # If it does, create the group
            if     ( not IsBound( sizes ) or desc[1] in sizes )
               and ( not IsBound( linprim ) or (desc[2] = 0) = linprim )
               and ( not IsBound( minblockdims ) or desc[2] in minblockdims )
            then
                gp := IrreducibleSolvableGroup( n, p, k );
            fi;

            # Now see if the group (if created) satisfies the other criteria.
            # If it does, return it
            if gp <> [ ] then
                passtest := true;
                i := 1;
                while passtest and i <= Length( funs ) do
                    passtest := funs[ i ]( gp ) = vals[ i ]
                                or ( IsList( vals[ i ] )
                                     and funs[ i ]( gp ) in vals[ i ] );
                    i := i + 1;
                od;
                if passtest then
                    return gp;
                fi;
            fi;
        od;
    od;

    return false;
end; # OneIrreducibleSolvableGroup( fun1, val1, fun2, val2, ... )


#############################################################################
##
#F  PrimitivePermGroupIrreducibleMatGroup(<matgrp>)
#F                   convert an irreducible matgroup to a primitive permgroup
##
##  'PrimitivePermGroupIrreducibleMatGroup'    converts  the matrix  group of
##  dimension  <n> over the field   with <p>^<k> elements  into a permutation
##  group of   degree '<p>^<k>\*\ <n>' that is   isomorphic to the semidirect
##  product of the matrix group with its underlying vector space w.r.t to the
##  operation  '<vector>  \*\ <matrix>'.  It   follows  from theory that  the
##  permutation group is primitive.
##
##  Note  that 'PrimitivePermGroupIrreducibleMatGroup'  does  *not* test  the
##  irreducibility of the  matrix group.  If this group  is reducible, it  is
##  your problem to work out the significance of the group returned.
##
PrimitivePermGroupIrreducibleMatGroup := function ( matgrp )
    local
        vecspace,    # underlying vector space
        veclist,     # list of all vectors
        vec,         # loops through veclist
        imlist,      # permutation in image form
        mat,         # loops through the generators of matgrp
        gens,        # generators of the output group
        v;           # any old non-zero vector

    vecspace := RowSpace( matgrp.dimension, matgrp.field );
    veclist := Elements( vecspace );
    gens := [ ];

    # Get the actions of matgrp's generators on the set of vectors
    for mat in matgrp.generators do
        imlist := [ ];
        for vec in veclist do
            Add( imlist, Position( veclist, vec * mat ) );
        od;
        Add( gens, PermList( imlist ) );
    od;
    # Note: The above seems to be faster than
    #                    gens := Operation( matgrp, veclist ).generators;
    # The improvement in speed is about 15% (averaged over all groups in the
    # IrredSol group library).

    # Get the action of adding one non-zero vector to the set of vectors.
    # (This is where the assumption of the irreducibility of matgrp is used.
    #  A general purpose ``matgrp semidirect vec-space'' function would have
    #  to go to the trouble here of choosing one non-zero vector from each
    #  invariant subspace.)
    v := veclist[ 1 ];
    if v = vecspace.zero then
        v := veclist[ 2 ];
    fi;
    imlist := [ ];
    for vec in veclist do
        Add( imlist, Position( veclist, vec + v ) );
    od;
    Add( gens, PermList( imlist ) );

    # We now have the semidirect product (provided matgrp is irreducible)
    return Group( gens, () );
end;



